package cn.lmxdev.ptms.dao;

import cn.lmxdev.ptms.bean.table.TDepartment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface IDepartmentDao {
    /* 插入 */
    boolean insert(@Param(value = "department") TDepartment department);

    /* 删除 */
    boolean delete(@Param(value = "id") Long id);

    /* 更新 */
    boolean update(@Param(value = "department") TDepartment department);

    /* 查询 */
    TDepartment find(@Param(value = "id") Long id);

    /* 根据名称查询 */
    TDepartment findByName(@Param(value = "name") String name);

    /* 计数 */
    long count(@Param(value = "department") TDepartment department);

    /* 查询列表 */
    List<TDepartment> select(@Param(value = "limitStart") Long limitStart, @Param(value = "limitEnd") Long limitEnd, @Param(value = "department") TDepartment department);

    /* 是否存在 */
    boolean has(@Param(value = "id") Long id);
}
